package com.example.translateappjava.Service.ForumApiService;

import com.example.translateappjava.Utils.Post;
import com.example.translateappjava.Utils.ApiResponse; // Import new ApiResponse
import com.example.translateappjava.Utils.GetPostsRequest; // Import new GetPostsRequest

import java.util.List;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;

public interface ApiService {
    // BaseURL is defined in ApiClient and should be "http://47.120.15.23:6001/"

    // Get posts (all or by category)
    // Backend endpoint: POST /user/getPost
    // Send GetPostsRequest in the body.
    // If request.category is null, backend should return all posts.
    @POST("user/getPost")
    Call<ApiResponse<List<Post>>> getPosts(@Body GetPostsRequest request);

    // Upload a new post
    // Backend endpoint: POST /user/uploadPost
    @POST("user/uploadPost")
    Call<ApiResponse<Post>> uploadPost(@Body Post post); // Assuming response includes the created/updated post in 'data'
    // If the response for uploadPost is just a status message without a Post object in "data",
    // you might use Call<ApiResponse<Object>> or Call<ApiResponse<Void>>
    // and then just check apiResponse.isSuccessful() and apiResponse.getMessage().
    // The provided screenshot for uploadPost shows the REQUEST body, not the response.
    // We assume the response is similar to getPost, but with a single Post in 'data'.
}